package com.diantou.tiku.response;


/**
 * 通用返回结果
 */
public class CommonReturnType {
    //表名对应请求的返回处理结果 "success"或者fail
    private String status;
    private Object data;

    //定义一个通用的创建方法
    public static CommonReturnType successReturn(Object result){
        return CommonReturnType.successReturn(result,"success");
    }
    public static CommonReturnType successReturn(Object result,String status){
        CommonReturnType type = new CommonReturnType();
        type.setData(result);
        type.setStatus(status);
        return type;
    }


    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }


    @Override
    public String toString() {
        return "CommonReturnType{" +
                "status='" + status + '\'' +
                ", data=" + data +
                '}';
    }
}
